dynamic class classes.ww_interface.Countdown extends MovieClip
{
    var N1;
    var N2;
    var no1;
    var no2;
    var ready1;
    var ready2;

    function Countdown()
    {
        super();
        this.ready1 = false;
        this.ready2 = false;
        this.N1 = 0;
        this.N2 = 0;
    }

    function setTo(no)
    {
        this.no1._y = 0 - this.no1.no0._y;
        this.no2._y = 0 - this.no2.no0._y;
        this.ready1 = false;
        this.ready2 = false;
        if (no < 10) 
        {
            this.N1 = 0;
        }
        else 
        {
            this.N1 = Math.floor(no / 10);
        }
        this.N2 = no - 10 * this.N1;
    }

    function countTo()
    {
        this.no1.onEnterFrame = mx.utils.Delegate.create(this, this.moveNo1);
        this.no2.onEnterFrame = mx.utils.Delegate.create(this, this.moveNo2);
    }

    function moveNo1()
    {
        this.no1._y = this.no1._y + (0 - this.no1["no" + this.N1]._y - this.no1._y) / 2;
        if (Math.abs(this.no1._y + this.no1["no" + this.N1]._y) < 1) 
        {
            this.ready1 = true;
            delete this.no1.onEnterFrame;
        }
    }

    function moveNo2()
    {
        this.no2._y = this.no2._y + (0 - this.no2["no" + this.N2]._y - this.no2._y) / 4;
        if (Math.abs(this.no2._y + this.no2["no" + this.N2]._y) < 1) 
        {
            this.ready2 = true;
            delete this.no2.onEnterFrame;
        }
    }

    function finished()
    {
        if (this.ready1 && this.ready2) 
        {
            return true;
        }
        return false;
    }

}
